package com.bw.merchant.model

import com.bw.common.entity.BaseRes
import com.bw.merchant.api.MerchantApiServer
import com.bw.merchant.entity.AddApplicationEntity
import com.bw.merchant.entity.ApprovalDetailEntity
import com.bw.merchant.entity.DetailMerchantEntity
import com.bw.merchant.entity.MerchantListEntityItem
import com.bw.merchant.entity.RecordingEntityItem
import com.bw.merchant.page.MerchantDetailActivity
import javax.inject.Inject

class MerchantRepository @Inject constructor(private val apiServer:MerchantApiServer) {
    //商家入驻 企业列表
    suspend fun loadMerchantData():BaseRes<List<MerchantListEntityItem>>{
        return apiServer.getMerchantData()
    }
    //企业详情
    suspend fun loadMerchantDetailData(id:Int):BaseRes<DetailMerchantEntity>{
        return apiServer.getMerchantDetailData(id)
    }

    //入驻申请记录
    suspend fun loadRecordingData():BaseRes<List<RecordingEntityItem>>{
        return apiServer.getRecordingData()
    }
    //创建商家入驻申请
    suspend fun loadAddMerchantData(addApplicationEntity: AddApplicationEntity):BaseRes<AddApplicationEntity>{
        return apiServer.getAddMerchantData(addApplicationEntity)
    }
    //入驻审批详情
    suspend fun loadApprovalDetailData(id: Int):BaseRes<ApprovalDetailEntity>{
        return apiServer.getApprovalDetailData(id)
    }
}